import pandas as pd
import numpy as np
import statsmodels.formula.api as smf
import sys
from natsort import natsorted
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
from IPython.core.interactiveshell import InteractiveShell
InteractiveShell.ast_node_interactivity = "all"
import ephys_functions as ephys
import importlib as imp
imp.reload(ephys);
def plot_full_experiment(file, excel, date, age, cell_num, smooth = False):
'''
Make all plots associated with a cell.
'''
#load excel sheet with information about traces
wave_info = pd.read_excel(excel)
#load csv of traces
igor = pd.read_csv(file)
all_waves = ephys.select_waves(igor, wave_info)
processed_waves = ephys.process_waves(all_waves)
if smooth:
smoothed_waves = ephys.smooth(processed_waves)
first_stim, second_stim, both_stim = ephys.divide_into_sections(smoothed_waves)
else:
first_stim, second_stim, both_stim = ephys.divide_into_sections(processed_waves)
ephys.plot_all(both_stim, wave_info, date, age, cell_num)
ephys.plot_max_SF(first_stim, both_stim, wave_info, date, age, cell_num)
ephys.plot_SF(both_stim, wave_info, date, age, cell_num)
cap_waves = ephys.find_cap_wave(all_waves)
ephys.plot_max_SF(cap_waves, cap_waves, wave_info, date, age, cell_num)
ephys.plot_inhibitory(first_stim, wave_info, date, age, cell_num)
#files
file = '/Volumes/lab_data_2/2016.11.15.csv'
excel = '/Volumes/lab_data_2/2016.11.15_Cell1.xlsx'
#cell information
date = '2016.11.15'
age = 'p14'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals
#files
file = '/Volumes/lab_data_2/2016.11.15.csv'
excel = '/Volumes/lab_data_2/2016.11.15_Cell2.xlsx'
#cell information
date = '2016.11.15'
age = 'p14'
cell_num = 2
plot_full_experiment(file, excel, date, age, cell_num)
inhibitory waves not present (bicuculline present)
#files
file = '/Volumes/lab_data_2/2016.11.17.csv'
excel = '/Volumes/lab_data_2/2016.11.17_Cell1.xlsx'
#cell information
date = '2016.11.17'
age = 'p16'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals
#files
file = '/Volumes/lab_data_2/2016.11.17.csv'
excel = '/Volumes/lab_data_2/2016.11.17_Cell2.xlsx'
#cell information
date = '2016.11.17'
age = 'p16'
cell_num = 2
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals inhibitory waves not present (bicuculline present)
#files
file = '/Volumes/lab_data_2/2016.12.13.csv'
excel = '/Volumes/lab_data_2/2016.12.13_Cell1.xlsx'
#cell information
date = '2016.12.13'
age = 'p15'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals
#files
file = '/Volumes/lab_data_2/2016.12.15.csv'
excel = '/Volumes/lab_data_2/2016.12.15_Cell1.xlsx'
#cell information
date = '2016.12.15'
age = 'p17'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals
#files
file = '/Volumes/lab_data_2/2016.12.15.csv'
excel = '/Volumes/lab_data_2/2016.12.15_Cell2.xlsx'
#cell information
date = '2016.12.15'
age = 'p17'
cell_num = 2
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals inhibitory waves not present (bicuculline present)
#files
file = '/Volumes/lab_data_2/2016.12.20.csv'
excel = '/Volumes/lab_data_2/2016.12.20_Cell1.xlsx'
#cell information
date = '2016.12.20'
age = 'p15'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals
#files
file = '/Volumes/lab_data_2/2016.12.21.csv'
excel = '/Volumes/lab_data_2/2016.12.21_Cell1.xlsx'
#cell information
date = '2016.12.21'
age = 'p15'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals
#files
file = '/Volumes/lab_data_2/2016.12.22.csv'
excel = '/Volumes/lab_data_2/2016.12.22_Cell1.xlsx'
#cell information
date = '2016.12.22'
age = 'p16'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals
#files
file = '/Volumes/lab_data_2/2016.12.22.csv'
excel = '/Volumes/lab_data_2/2016.12.22_Cell2.xlsx'
#cell information
date = '2016.12.22'
age = 'p16'
cell_num = 2
plot_full_experiment(file, excel, date, age, cell_num)
no final maximals no final maximals inhibitory waves not present (bicuculline present)
#files
file = '/Volumes/lab_data_2/2016.12.27.csv'
excel = '/Volumes/lab_data_2/2016.12.27_Cell1.xlsx'
#cell information
date = '2016.12.27'
age = 'p15'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num, smooth = True)
no single fibers no final maximals no single fibers no single fibers no final maximals
#files
file = '/Volumes/lab_data_2/2017.01.03.csv'
excel = '/Volumes/lab_data_2/2017.01.03_Cell1.xlsx'
#cell information
date = '2017.01.03'
age = 'p21'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num)
no final maximals no final maximals
#files
file = '/Volumes/lab_data_2/2017.01.04.csv'
excel = '/Volumes/lab_data_2/2017.01.04_Cell1.xlsx'
#cell information
date = '2017.01.04'
age = 'p22'
cell_num = 1
plot_full_experiment(file, excel, date, age, cell_num)
no single fibers no final maximals no single fibers no single fibers no final maximals